package priv.tuyou.redis.data.structure;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

import java.util.stream.IntStream;

public class ListTest {

    public static void main(String[] args) {
        long startTime = System.currentTimeMillis();
        try(JedisPool pool = new JedisPool("localhost", 6379)) {
            IntStream.rangeClosed(1, 1000_000)
                    .parallel()
                    .forEach(i -> {
                        System.out.println(i);
                        try (Jedis resource = pool.getResource()) {
                            resource.rpop("list");
                        }
                    });
        }
        long endTime = System.currentTimeMillis();
        System.out.println("总共时间：" + (endTime - startTime) / 1000);
    }
}
